package ysq.xyg.host.model.po;

import lombok.NoArgsConstructor;

import lombok.Data;
import ysq.xyg.base.util.BaseConstant;
import ysq.xyg.base.util.BaseUtil;
import ysq.xyg.sys.model.po.SysUser;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;


/**
 * 房产模块-小区信息实体类
 *
 * @author shengQiang yu
 * @date 2019-7-1 15:25:38
 */
@Data
@NoArgsConstructor
@Table(name = "xyg_host_item")
public class HostItem implements Serializable{

	/**
     * 主键
     */ 
	@Id
	private String id;
	
	/**
     * 名称
     */ 
	@Column(name = "name")
	private String name;

	/**
	 * 房屋类型
	 */
	@Column(name = "host_type")
	private String hostType;

	/**
     * 封面图
     */ 
	@Column(name = "cover_image")
	private String coverImage;
	
	/**
     * 商品图，多个用“，”隔开
     */ 
	@Column(name = "images")
	private String images;
	
	/**
     * 均价
     */ 
	@Column(name = "price")
	private int price;
	
	/**
     * 最小户型面积
     */ 
	@Column(name = "min_apartment_area")
	private int minApartmentArea;
	
	/**
     * 最大户型面积
     */ 
	@Column(name = "max_apartment_area")
	private int maxApartmentArea;
	
	/**
     * 最小户型
     */ 
	@Column(name = "min_rooms")
	private int minRooms;
	
	/**
     * maxRooms
     */ 
	@Column(name = "max_rooms")
	private int maxRooms;
	
	/**
     * 城市id
     */ 
	@Column(name = "city_id")
	private String cityId;
	
	/**
     * 区域id
     */ 
	@Column(name = "area_id")
	private String areaId;
	
	/**
     * 详细地址
     */ 
	@Column(name = "address")
	private String address;
	
	/**
     * 分销状态：1、开启，2、关闭
     */ 
	@Column(name = "share_type")
	private String shareType;
	
	/**
     * 佣金描述
     */ 
	@Column(name = "share_money")
	private String shareMoney;
	
	/**
     * 负责人
     */ 
	@Column(name = "user_id")
	private String userId;
	
	/**
     * 栏目描述
     */ 
	@Column(name = "description")
	private String description;
	
	/**
     * 内容
     */ 
	@Column(name = "content")
	private String content;
	
	/**
     * 标签,多个用“，”隔开
     */ 
	@Column(name = "tag")
	private String tag;
	
	/**
     * 热卖新房状态：1、开启，2、关闭
     */ 
	@Column(name = "hot_sale_state")
	private String hotSaleState;
	
	/**
     * 排序号，数据越大越往前
     */ 
	@Column(name = "sort")
	private String sort;

	/**
	 *经度，浮点数，范围为180 ~ -180。
	 */
	@Column(name = "longitude")
	private String longitude;

	/**
	 *纬度，浮点数，范围为90 ~ -90
	 */
	@Column(name = "latitude")
	private String latitude;

	/**
     * 删除标识：1、正常，2、已删除
     */ 
	@Column(name = "remove_tag")
	private String removeTag;
	
	/**
     * 创建人
     */ 
	@Column(name = "create_user")
	private String createUser;
	
	/**
     * 创建时间
     */ 
	@Column(name = "create_time")
	private Date createTime;
	
	/**
     * 修改人
     */ 
	@Column(name = "update_user")
	private String updateUser;
	
	/**
     * 修改时间
     */ 
	@Column(name = "update_time")
	private Date updateTime;

	/**
	 * 区域名称
	 */
	@Transient
	private String areaName;
	/**
	 * 城市名称
	 */
	@Transient
	private String cityName;

	/**
	 * 负责人名称
	 */
	@Transient
	private String userName;

	/**
	 * 负责人头像
	 */
	@Transient
	private String userLogo;

	/**
	 * 负责人手机号
	 */
	@Transient
	private String userPhone;

	/**
	 * 图片集合
	 */
	@Transient
	private String[] imageList;

	/**
	 * 标签集合
	 */
	@Transient
	private String[] tagList;

	/**
	 * 分享数
	 */
	@Column(name = "share_number")
	private Integer shareNumber;

	/**
	 * 开盘时间
	 */
	@Column(name = "open_time")
	private Date openTime;

	/**
	 * 交通数目
	 */
	@Column(name = "traffic_number")
	private String trafficNumber;

	/**
	 * 交通描述
	 */
	@Column(name = "traffic_desc")
	private String trafficDesc;

	/**
	 * 教育数目
	 */
	@Column(name = "teach_number")
	private String teachNumber;

	/**
	 * 教育描述
	 */
	@Column(name = "teach_desc")
	private String teachDesc;

	/**
	 * 医疗数目
	 */
	@Column(name = "medical_number")
	private String medicalNumber;

	/**
	 * 医疗描述
	 */
	@Column(name = "medical_desc")
	private String medicalDesc;

	/**
	 * 商业数目
	 */
	@Column(name = "business_number")
	private String businessNumber;

	/**
	 * 商业描述
	 */
	@Column(name = "business_desc")
	private String businessDesc;

	/**
	 * 楼盘特色
	 */
	@Column(name = "feature")
	private String feature;

	/**
	 * 楼盘总价，由单价*面积计算，可手填
	 */
	@Column(name = "all_price")
	private String allPrice;

	/**
	 * 装修标准
	 */
	@Column(name = "decoration")
	private String decoration;

	/**
	 * 产权年限
	 */
	@Column(name = "property_year")
	private String propertyYear;

	/**
	 * 开发商
	 */
	@Column(name = "developer")
	private String developer;

	@Transient
	private String openTimeStr;

	/**
	 * 户型
	 */
	@Column(name = "layout_content")
	private String layoutContent;

	public HostItem(SysUser sysUser) {
		this.id= BaseUtil.uId();
		this.removeTag= BaseConstant.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.createUser = sysUser.getId();
		this.updateTime = new Date();
		this.updateUser = sysUser.getId();
	}
}